Reverse Coding Challenge 1

59

Reverse Coding Challenge 1 -

public class Program 
{	//"A4B5C2" ➞ "AAAABBBBBCC"	
	public static string MysteryFunc(string s) 
    {  string s2 = "";
        for (int i = 0; i < s.Length; i+=2)
        s2 += new string(s[i], int.Parse((s[i+1]).ToString()));
        return s2;
		}
}

Comments

Submit
0 Comments